<template>
	<view class="Commodity_List" @tap="tac1(getdata)">
		<!-- 商品列表组件 -->
		<!-- 引入单个商品组件 -->
		<commodityVue :dataList="commodityList"></commodityVue>
		<view class="">
			{{getdata}}
		</view>
	</view>
</template>
<script>

	import commodityVue from "./commodity.vue"
	// 引入接口，获取数据
	export default {
		props: {
			getdata: Number
		},
		data() {
			return {
				fcid: 0,
				// 定义获取数据分类的数组
				comlist: [],
				// 定义获取数据的数组
				comitem: [],
				commodityList: [{
						id: "1",
						imgUrl: "../../static/images/鞋子1.jpg",
						name: "鞋子爆款2024，鞋子男,回力鞋子男款2024新款秋季厚底板鞋小众原创高级感潮牌百搭休闲鞋",
						p_price: "￥299",
						o_prict: "￥599",
						discount: "4.9折"
					},
					{
						id: "2",
						imgUrl: "../../static/images/鞋子2.jpg",
						name: "国货品牌联名男鞋2024秋款新款男士休闲百搭秋冬小白板鞋运动潮鞋",
						p_price: "￥113",
						o_prict: "￥128",
						discount: "8.8折"
					},
					{
						id: "3",
						imgUrl: "https://gw.alicdn.com/imgextra/i3/1773748534/O1CN01AlTq5B2Cud0zUvhLU_!!1773748534.jpg",
						name: "PtonUmi 奶盐咸桃少女感爱心提花针织开衫女秋冬短款宽松毛衣外套",
						p_price: "￥168",
						o_prict: "￥178",
						discount: "9.4折"
					},
					{
						id: "5",
						imgUrl: "https://gw.alicdn.com/imgextra/i2/284411598/O1CN014pWV4X1NfvuxjdG8e_!!284411598.jpg",
						name: "QDQD 甜美马卡龙90白鸭绒小个子短款粉色连帽面包羽绒服女冬季",
						p_price: "￥499",
						o_prict: "￥559",
						discount: "8.3折"
					}
				],
			}
		},
		mounted() {},

		components: {
			commodityVue
		},

		methods: {
			// async getlist(getdata) {
			// 	let page_id = getdata;
			// 	try {
			// 		const data = await getComList({page_id}); 
			// 		this.comlist = data.result;
			// 		this.comitem = data;
			// 		console.log("comitem",this.comitem);
			// 		console.log("getdata",getdata);
			// 	} catch (error) {
			// 		console.error('获取商品列表数据出错:', error);
			// 	}
			// },
			// tac1(getdata) {
			// 	let mydataIndex = getdata;
			// 	console.log("mydataIndex", mydataIndex)
			// 	console.log("getdata", getdata)
			// 	this.getlist(getdata);
			// }
		}
	}
</script>

<style>
	.Commodity_List {
		background-color: antiquewhite !important;
		z-index: 100;
	}
</style>